<template>
  <div class="my-comment">
    <img src="@/assets/img/user.jpg" alt="用户头像">
    <div class="message">
      <textarea ref="input" name="" id="my-apply" placeholder="评论" @click="inputClick"></textarea>
      <div class="comment-message">
        <div class="emot">
          <img src="@/assets/img/emot.png" alt="表情">
          <img src="@/assets/img/email.png" alt="@">
        </div>
        <div class="send">评论</div>
      </div>
    </div>
    
  </div>
</template>

<script>
  export default {
    methods: {
      inputClick() {
        this.$message.error('请先完成登录哦~');
        this.$refs.input.style.readonly = 'readonly'
      }
    }
  }
</script>

<style scoped>
.my-comment {
  margin: 30px 0;
  display: flex;
}

.my-comment img {
  width: 50px;
  height: 50px;
  margin-right: 20px;
}

/* 输入框 */
.message {
  width: 100%;
}
#my-apply {
  width: 100%;
  min-height: 65px;
  font-size: 13px;
  resize: none;
  outline: none;
  padding: 5px;
  border: 1px solid #999;
}

/* 最后一行 */
.comment-message {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}
/* 表情 */
.emot img {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  cursor: pointer;
}
/* 发送 */
.send {
  width: 45px;
  height: 25px;
  border-radius: 5px;
  font-size: 14px;
  color: #fff;
  text-align: center;
  line-height: 25px;
  background: url(~@/assets/img/button.png) 0 -387px;
  cursor: pointer;
}
.send:hover {
  background-position-y: -469px;
}
</style>